package com.emperor.user.app;

import java.util.Map;

import org.apache.log4j.Logger;

import com.emperor.core.app.App;
import com.emperor.core.app.AppConstant;
import com.emperor.core.app.AppCtrl;

public class UserAppCtrl implements AppCtrl {

	public final static String USER_CTRL = "user.ctrl";
	public final static String USER_NEW = "user.new";
	
	public static Logger log = Logger.getLogger(UserAppCtrl.class);
	
	@Override
	public void doProcess(Map<String, Object> params) {
		App app = null;
		if (params == null) {
			log.error("Param is null");
		} else if (params.get(AppConstant.ACTION).equals(USER_NEW)) {
			app = new UserAppNew(params);
		}
		
		if (app != null)
			app.open();
	}

}
